"""
Copyright 2010-2013 John Kemp <kemp@iualdii.net>

This file is part of GSBEdit.

GSBEdit is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

GSBEdit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GSBEdit.  If not, see <http://www.gnu.org/licenses/>.
"""


import wx

import ui_elements.mainwindow as mw
import ui_elements.mod_selector as ms
import app.update_check as uc


CURRENT_VERSION=130721


def show_mod_select():
    ms.ModSelectorWindow(None, set_starting_mod, False)
    

def set_starting_mod(gsbi):
    mw.MainWindow(gsbi)


app = wx.App(0)
version,changelog = uc.get_latest_version(CURRENT_VERSION)
print "Current version is %u, latest version is %u." % (CURRENT_VERSION, version)
if version != CURRENT_VERSION:
    changelog = uc.parse_changelog(changelog)
    checker = uc.UpdateDisplayWindow(None, version, changelog, show_mod_select)
else:
    show_mod_select()
    
app.MainLoop()
